home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / libsrc~1.z / libsrc~1 / ctermid.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-12-28  |  637 b   |  36 lines

  1. #include "lib.h"
  2.  
  3. /*  ctermid(3)
  4.  *
  5.  *  Author: Terrence Holm          Aug. 1988
  6.  *
  7.  *
  8.  *  Ctermid(3) returns a pointer to a string naming the controlling
  9.  *  terminal. If <name_space> is NULL then local static storage
  10.  *  is used, otherwise <name_space> must point to storage of at
  11.  *  least L_ctermid characters.
  12.  *
  13.  *  Returns a pointer to "/dev/tty".
  14.  */
  15.  
  16. #include  <stdio.h>
  17.  
  18. #ifndef L_ctermid
  19. #define L_ctermid  9
  20. #endif
  21.  
  22.  
  23. char *ctermid( name_space )
  24.   char *name_space;
  25.  
  26.   {
  27.   static char termid[ L_ctermid ];
  28.  
  29.   if ( name_space == NULL )
  30.     name_space = termid;
  31.  
  32.   strcpy( name_space, "/dev/tty" );
  33.  
  34.   return( name_space );
  35.   }
  36.